<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />

<div class="t_bar">
        <span class="color_red">*</span>管理服务团队人员名单
    </div>
    <table  id="eq_table1" class="t_css">
           <col style="width: 5%"/>
           <col style="width: 5%"/>
           <col style="width: 13%"/>
           <col style="width: 5%"/>
           <col style="width: 5%"/>
           <col style="width: 13%"/>
           <col style="width: 13%"/>
           <col style="width: 8%"/>
           <col style="width: 14%"/>
           <col style="width: 14%"/>
           <col style="width: 5%"/>
           <thead >
                   <tr style="border:1px solid #B7D1E6">
                       <th class="TblHead" align="center">选择</th>
                       <th class="TblHead" align="center">序号</th>
                       <th class="TblHead" align="center">姓名</th>
                       <th class="TblHead" align="center">性别</th>
                       <th class="TblHead" align="center">年龄</th>
                       <th class="TblHead" align="center">职务</th>
                       <th class="TblHead" align="center">职称</th>
                       <th class="TblHead" align="center">学历</th>
                       <th class="TblHead" align="center">专业</th>
                       <th class="TblHead" align="center">工作分工</th>
                       <th class="TblHead" align="center">是否接受从业人员培训</th>
                   </tr>
           </thead>
           <tbody id="tab">
                   <tr style="display:none;">
                       <td align="center">
                           <input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selMileStones" >
                       </td>
                       <td align="center">
                           <span name="team_persons|team_person[0]@seq_no" >[index]</span> 
                       </td>
                       <td align="center">
                           <input name="team_persons|team_person[0]|basic_info|name" style="width: 80%" label="姓名" type="text" required class="input_text required" value="" maxlength="20"/>
                       </td>
                       <td align="center">
				           <cpt:select id="gender_one_[index]" key="gender"  className="input_css" name="gender1"
				                       onChange="initControlValue(this.id);" value="" style="width:38px;border: 1px solid #A1C0DC;"></cpt:select>
				           <input type="hidden" name="team_persons|team_person[0]|basic_info|gender1_value" value="" class="input_text required" label="性别"/>
				           <input type="hidden" name="team_persons|team_person[0]|basic_info|gender1_name" value="" />
                       </td>
                       <td align="center">
                           <input name="team_persons|team_person[0]|basic_info|age" style="width: 60%;text-align:right;" label="年龄" type="text" required class="input_text required" onfocus="InitInput.setNumber(this,3,0,0)" value=""/>
                       </td>
                       <td align="center">
                           <input name="team_persons|team_person[0]|basic_info|job" style="width: 80%" label="职务" type="text" required class="input_text required" value="" maxlength="20"/>
                       </td>
                       <td align="center">
                           <input name="team_persons|team_person[0]|basic_info|prof_title" style="width: 80%" label="职称" type="text" required class="input_text required" value="" maxlength="20"/>
                       </td>
                       <td align="center">
                           <input name="team_persons|team_person[0]|basic_info|education" style="width: 80%" label="学历" type="text" required class="input_text required" value="" maxlength="6"/>
                       </td>
                       <td align="center">
                           <input name="team_persons|team_person[0]|basic_info|major" style="width: 80%" label="专业" type="text" required class="input_text required" value="" maxlength="20"/>
                       </td>
                       <td align="center">
                           <input name="team_persons|team_person[0]|basic_info|work" style="width: 80%" label="工作分工" type="text" required class="input_text required" value="" maxlength="20"/>
                       </td>
                       <td align="center">
                           <cpt:select id="accept_istrain[index]" key="accept_istrain"  className="input_css" name="accept_istrain"
                                       onChange="initControlValue(this.id);" value="" style="width:38px;border: 1px solid #A1C0DC;"></cpt:select>
                           <input type="hidden" name="team_persons|team_person[0]|basic_info|accept_istrain_value" value="" class="input_text required" label="是否接受从业人员培训"/>
                           <input type="hidden" name="team_persons|team_person[0]|basic_info|accept_istrain_name" value="" />
                       </td>
                   </tr>
                   
                   
                   <c:set value="0" var="index" scope="page"/>
                   <x:forEach select="$xmlData/data/team_persons/team_person" var="team_person">
                   
                   <c:choose>
                       <c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
                       <c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
                   </c:choose>
                   <tr >
                       <td align="center">
                           <input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selMileStones" >
                       </td>
                       <td align="center">
                           <span name="team_persons/team_person[${flag}${index}]@seq_no"><x:out select="$team_person/@seq_no"/></span> 
                       </td>
                       
                       <td align="center">
                           <input name="team_persons/team_person[${flag}${index}]/basic_info/name" label="姓名"  style="width: 80%" type="text" required class="input_text required" value="<x:out select="$team_person/basic_info/name"/>" maxlength="20"/>
                       </td>
                       <td align="center">
                           <c:set var="gender1"><x:out select="$team_person/basic_info/gender1_value" /></c:set>
                           <cpt:select id="gender_one_${index}" key="gender" className="input_css" name="gender1"
                                       onChange="initControlValue(this.id);" value="${gender1 }" style="width:38px;border: 1px solid #A1C0DC;"></cpt:select>
                           <input type="hidden" name="team_persons/team_person[${flag}${index}]/basic_info/gender1_value" value="${gender1 }" class="input_text required" label="性别"/>
                           <input type="hidden" name="team_persons/team_person[${flag}${index}]/basic_info/gender1_name" value="<x:out select="$team_person/basic_info/gender1_name" />" />
                       </td>
                       <td align="center">
                           <input name="team_persons/team_person[${flag}${index}]/basic_info/age" label="年龄" style="width: 60%;text-align:right;" type="text" required class="input_text required" onfocus="InitInput.setNumber(this,3,0,0)" value="<x:out select="$team_person/basic_info/age"/>"/>
                       </td>
                       <td align="center">
                           <input name="team_persons/team_person[${flag}${index}]/basic_info/job" label="职务" style="width: 80%" type="text" required class="input_text required" value="<x:out select="$team_person/basic_info/job"/>" maxlength="20"/>
                       </td>
                       <td align="center">
                           <input name="team_persons/team_person[${flag}${index}]/basic_info/prof_title" label="职称" style="width: 80%" type="text" required class="input_text required" value="<x:out select="$team_person/basic_info/prof_title"/>" maxlength="20"/>
                       </td>
                       <td align="center">
                           <input name="team_persons/team_person[${flag}${index}]/basic_info/education" label="学历" style="width: 80%" type="text" required class="input_text required" value="<x:out select="$team_person/basic_info/education"/>" maxlength="6"/>
                       </td>
                       <td align="center">
                           <input name="team_persons/team_person[${flag}${index}]/basic_info/major" label="专业" style="width: 80%" type="text" required class="input_text required" value="<x:out select="$team_person/basic_info/major"/>" maxlength="20"/>
                       </td>
                       <td align="center">
                           <input name="team_persons/team_person[${flag}${index}]/basic_info/work" label="工作分工" style="width: 80%" type="text" required class="input_text required" value="<x:out select="$team_person/basic_info/work"/>" maxlength="20"/>
                       </td>
                       <td align="center">
                           <c:set var="accept_istrain"><x:out select="$team_person/basic_info/accept_istrain_value" /></c:set>
                           <cpt:select id="accept_istrain${index }" key="accept_istrain" className="input_css" name="accept_istrain"
                                       onChange="initControlValue(this.id);" value="${accept_istrain }" style="width:38px;border: 1px solid #A1C0DC;"></cpt:select>
                           <input type="hidden" name="team_persons/team_person[${flag}${index}]/basic_info/accept_istrain_value" value="${accept_istrain }" class="input_text required" label="是否接受从业人员培训"/>
                           <input type="hidden" name="team_persons/team_person[${flag}${index}]/basic_info/accept_istrain_name" value="<x:out select="$team_person/basic_info/accept_istrain_name" />" />
                       </td>
                   </tr>
                   <c:set value="${index+1}" var="index" scope="page"/>
                   </x:forEach>
               </tbody>
       </table>
       <table width="98%" align="center">
               <tr >
                   <td>
                       <input class="button_02" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('eq_table1',999,'管理服务团队人员名单内容最多只能填写999条')){addNewRow('eq_table1');showDateTag('eq_table1');}try{top.resizeFrame();}catch(e){};">
                       <input class="button_02" name="cmdMovePrev" type=button value="上移" onclick="movePrev('eq_table1','selMileStones');">
                       <input class="button_02" name="cmdMoveNext" type=button value="下移" onclick="moveNext('eq_table1','selMileStones');">
                       <input class="button_02" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('eq_table1','管理服务团队人员名单');">
                   </td>
               </tr>
       </table>
<script>
function initControlValue(objId){
    
    var name="";
    var obj=$("#"+objId);
    if(obj.is("select")){
        name=obj.attr("name");
        obj.parent().children("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).find("option:selected").val());
        $("#"+objId).parent().children("input[name$='"+name+"_name']").val($("#"+objId).find("option:selected").text());
    }
   
    else if(obj.is(":radio")){
        name=obj.attr("name");
        if(obj.is(":checked")){//如果被选中
            //alert($("#"+objId).val());        
            obj.parents("table").find("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).val());
            $("#"+objId).parent().children("input[name$='"+name+"_name']").val($("#"+objId).next().text());
        }
        else{
            
            obj.parents("table").find("input[name$='"+name+"_value'][type='hidden']").val("");
        }
    }else if(obj.is(":checkbox")){
        name=obj.attr("name");
        if(obj.is(":checked"))//如果被选中
            obj.parent().find("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).val());
        else
            obj.parent().find("input[name$='"+name+"_value'][type='hidden']").val("");
    }else{
        name=obj.attr("id");
        obj.parents("td").find("input[name$='"+name+"_name'][type='hidden']").val(obj.val());
        obj.parents("td").find("input[name$='"+name+"_code'][type='hidden']").val($("#"+objId+"_hideId").val());
    }   
}
</script>